#!/usr/bin/python
#coding=u8

class BaseHandler(object):
    """Handler基类，所有处理请求的类都继承该类。
    """

    def __init__(self):
        pass

    def get(self, req, resp):
        return self.error(req, resp)

    def post(self, req, resp):
        return self.error(req, resp)

    def put(self, req, resp):
        return self.error(req, resp)

    def head(self, req, resp):
        return self.error(req, resp)

    def error(self, req, resp, status='405 Method Not Allowed'):
        resp.status = status 
        return resp.respond(status)




